package com.lmk.mkcc.feign;

import com.lmk.mkcc.CourseDoc;
import com.lmk.mkcc.enums.GlobalErrorCode;
import com.lmk.mkcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseEsServiceFallbackFactory implements FallbackFactory<CourseEsService> {
    @Override
    public CourseEsService create(Throwable throwable) {
        return new CourseEsService() {
            @Override
            public JSONResult saveCourseEs(CourseDoc courseDoc) {
                return JSONResult.error(GlobalErrorCode.FUSE_ERROR);
            }

            @Override
            public JSONResult delectCourseEs(Long id) {
                return JSONResult.error(GlobalErrorCode.FUSE_ERROR);
            }
        };
    }
}
